package demolist;

public class Test {
    public static void main(String[] args) {
        MySingleList mySingleList = new MySingleList();
        mySingleList.addLast(1);
        mySingleList.addLast(2);
        mySingleList.addLast(3);
        mySingleList.addLast(4);
        //mySingleList.addLast(5);
        mySingleList.show();

        System.out.println(mySingleList.kthToLast2(1));

        //MySingleList.ListNode ret = mySingleList.reverseList();

//        MySingleList.ListNode ret = mySingleList.findMiddleNode1();
//        System.out.println(ret.val);

//        MySingleList.ListNode ret = mySingleList.findMiddleNode2();
//        System.out.println(ret.val);
    }



    public static void main1(String[] args) {
        MySingleList mySingleList = new MySingleList();
//        mySingleList.createList();
//        mySingleList.show();
//        System.out.println();
//        mySingleList.show();
//        System.out.println();
//        System.out.println(mySingleList.size());
//        System.out.println(mySingleList.contains(99));

        mySingleList.addFirst(77);
        mySingleList.addFirst(88);
        mySingleList.addFirst(88);
        mySingleList.addFirst(88);
        mySingleList.show();
        System.out.println();
        System.out.println("======================");

        //mySingleList.addIndex(3, 12);

        //mySingleList.remove(88);

        //mySingleList.removeAllKey(88);

        mySingleList.clear();
        mySingleList.show();
    }
}
